package com.openharmony.filepicker.filetype;


import com.openharmony.filepicker.ResourceTable;

public class AudioFileType extends FileType {

    public AudioFileType() {
        this.setFileType("Audio");
        this.setFileIconResId(ResourceTable.Media_ic_music_file_picker);
    }

    @Override
    public boolean verify(String fileName) {
        boolean isHasSuffix = fileName.contains(".");
        if (!isHasSuffix) {
            return false;
        }
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);

        switch (suffix) {
            case "aif":
            case "iff":
            case "m3u":
            case "m4a":
            case "mid":
            case "mp3":
            case "mpa":
            case "wav":
            case "wma":
            case "ogg":
            case "flac":
            case "ape":
            case "alac":
                return true;
            default:
                return false;
        }
    }

}
